﻿<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeBehind="UserTreeMgr.aspx.cs" Inherits="Web.Admin.Core.UserTreeMgr" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
     <script type="text/javascript">
         var subwin = {};
         var puserid;

         function refreshuser(userid) {
             puserid = userid;
             if (subwin['usermgr']) {
                 var grid = subwin['usermgr'].Ext.get('USERINFO_Grid');
                 if (grid) {
                     subwin['usermgr'].refreshUser(userid); 
                 }
             }

         }
         function reloadtree() {

             userTree.root.reload();
             //userTree.root.expand(false);
             //App.direct.reload(puserid);
         }
     </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" ViewStateMode="Disabled" />
    <ext:Viewport runat="server">
        <Items>
            <ext:BorderLayout runat="server">
                <West>
                    <ext:Panel runat="server" Title="客户列表" Width="200">
                        <Items>
                            <ext:TreePanel runat="server" ID="userTree" Border="false" Title="Examples" AutoScroll="true"
                                Lines="true" RootVisible="false" AutoHeight="true" Header="False" HideParent="True">
                                <Root>
                                    <ext:AsyncTreeNode Text="users" NodeID="root" Expanded="true" />
                                </Root>
                                <Loader>
                                    <ext:PageTreeLoader RequestMethod="GET" OnNodeLoad="GetUserNodes" PreloadChildren="true">
                                        <EventMask ShowMask="true" Target="Parent" Msg="正在加载..." />
                                    </ext:PageTreeLoader>
                                </Loader>
                                <Listeners>
                                    <ContextMenu Handler="if(node.isLeaf()){currentNodeID=node.id; return true;}else return false;" />
                                    <Click Handler="refreshuser(node.id)" />
                                </Listeners>
                            </ext:TreePanel>
                        </Items>
                    </ext:Panel>
                </West>
                <Center>
                
                <ext:TabPanel runat="server" Title="sf">
                 <Items>
                 <ext:Panel runat="server" Title="设备" Layout="FitLayout"  >
                 
                 </ext:Panel>
                 <ext:Panel runat="server" ID="userPanel" runat="server" Title="下级客户"  Layout="FitLayout"  >
                 <AutoLoad Url="usermgr.aspx?puserid=123" ShowMask="true" Mode="IFrame" Scripts="false"></AutoLoad>
                 </ext:Panel>
                 </Items>
                </ext:TabPanel>
                  
                </Center>
            </ext:BorderLayout>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
